import 'package:flutter/material.dart';
import 'package:flutter_demo/router/router_demo.dart';

import 'home_page.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
//第一个页面可以用以下两种方式，不能同时存在，若定义了"/"就不能定义home
//      home: MyHomePage(),
        initialRoute: "/",
        routes: {
          '/': (context) => MyHomePage(),
          'router_demo': (context) => RouterDemo(),
          'router_demo2': (context) => RouterDemo2()
        }

//        home: _HelloWorldDemo()
        ////
        );
  }
}

class _HelloWorldDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text("title")), body: Text("helloworld"));
  }
}
